RedisClientBase{
  this.socketChannel=socketChannel;
}
connect{
  final Queue<Promise<Reply>> queue=new LinkedList<>();
  SocketChannel socketChannel=new NioSocketChannel();
  final RedisClientBase client=new RedisClientBase(socketChannel,queue);
  socketChannel.pipeline().addLast(new RedisCommandEncoder(),new RedisReplyDecoder(),new ChannelInboundMessageHandlerAdapter<Reply<?>>(){
    @Override public void messageReceived(    ChannelHandlerContext channelHandlerContext,    Reply<?> reply) throws Exception {
      Promise<Reply> poll;
        poll=queue.poll();
  final Promise<RedisClientBase> promise=new Promise<>();
  socketChannel.connect(new InetSocketAddress(host,port)).addListener(new ChannelFutureListenerPromiseAdapter<>(promise,client));
}
messageReceived{
  Promise<Reply> poll;
    poll=queue.poll();
    if (poll == null) {
  poll.set(reply);
}
send{
  Promise<Reply> reply=new Promise<>();
    queue.add(reply);
  return reply;
}
